package com.cxyd.common.utils;

import com.cxyd.common.exception.ErrorCode;

import java.io.Serializable;

/**
 * 其他系统调用[wcs-api]接收到的反馈信息
 */
public class ApiResult implements Serializable {
    private static final long serialVersionUID = 1L;
    private String code = "0";
    private String msg = "成功";
    private String requestPk = "404";

    public ApiResult success(String msg) {
        this.msg = msg;
        return this;
    }

    public ApiResult feedBack(String requestPk) {
        this.requestPk = requestPk;
        return this;
    }

    public ApiResult feedBack(String msg, String requestPk) {
        this.code = ErrorCode.API_SERVER_ERROR;
        this.msg = msg;
        this.requestPk = requestPk;
        return this;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getRequestPk() {
        return requestPk;
    }

    public void setRequestPk(String requestPk) {
        this.requestPk = requestPk;
    }
}
